package uk.co.q3c.deplan.client.ui.component;

import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.user.client.Command;
import com.google.gwt.user.client.ui.Button;

public class CommandButton extends Button implements ClickHandler {

	private Command command;

	public CommandButton() {
		super();
	}

	@Override
	public void onClick(ClickEvent event) {
		if (command != null) {
			command.execute();
		}
	}

	public Command getCommand() {
		return command;
	}

	public void setCommand(Command command) {
		this.command = command;
	}

}
